home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / dos / conio.c < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-17  |  1.0 KB  |  44 lines

  1. #ident "$Id: conio.c,v 1.3 2004/12/17 17:47:16 hpa Exp $"
  2. /* ----------------------------------------------------------------------- *
  3.  *   
  4.  *   Copyright 2001-2004 H. Peter Anvin - All Rights Reserved
  5.  *
  6.  *   This program is free software; you can redistribute it and/or modify
  7.  *   it under the terms of the GNU General Public License as published by
  8.  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
  9.  *   Boston MA 02111-1307, USA; either version 2 of the License, or
  10.  *   (at your option) any later version; incorporated herein by reference.
  11.  *
  12.  * ----------------------------------------------------------------------- */
  13.  
  14. /*
  15.  * conio.c
  16.  *
  17.  * Output to the screen
  18.  */
  19.  
  20. #include <stdarg.h>
  21. #include "mystuff.h"
  22.  
  23. int putchar(int ch)
  24. {
  25.   if ( ch == '\n' )
  26.     putchar('\r');
  27.   asm("movb $0x02,%%ah ; int $0x21" : : "d" (ch));
  28.   return ch;
  29. }
  30.  
  31. /* Note: doesn't put '\n' like the stdc version does */
  32. int puts(const char *s)
  33. {
  34.   int count = 0;
  35.  
  36.   while ( *s ) {
  37.     putchar(*s);
  38.     count++;
  39.     s++;
  40.   }
  41.  
  42.   return count;
  43. }
  44.